
export default {
  config: {
    category: 'XTimeSelect',
    // 时间步长
    timeStep: '00:15',
    // 开始时间
    startTime: '00:00',
    // 结束时间
    endTime: '23:30',
    // 范围选择时开始日期的占位内容
    startPlaceholder: '开始时间',
    // 范围选择时结束日期的占位内容
    endPlaceholder: '结束时间',
    // 控件左侧label内容
    label: '时间选择器',
    placeholder: '请选择',
    // 绑定的值
    value: '',
    // 表单name
    name: 'timeSelect',
    endName: '',
    // 任意时间
    timePicker: false,
    arrowControl: true,
    selectableRange: '',
    format: 'HH:mm:ss'
  },
  name: 'XTimeSelect',
  render: (self, h) => {
    const data = self.ele
    /* function aaa() {
      let temp = ''
      if (data.endName) {
        temp = <el-time-select
          input={self.$emit('input', data.value)}
          picker-options={
            {
              start: data.startTime,
              step: data.timeStep,
              end: data.endTime
            // minTime: formValue[data.name]
            }
          }
          placeholder={data.endPlaceholder}
          class={{ form_input: true }}
        />
      }
      return temp
    } */
    if (data.timePicker) {
      return (
        <el-time-picker
          format={data.format}
          arrow-control={data.arrowControl}
          picker-options={
            {
              selectableRange: data.selectableRange
            }
          }
          placeholder={data.placeholder}
          clearable
          class={{ form_input: true }}
          attr={{}}
          v-model={data.value}
          input={self.$emit('input', data.value)}
        />
      )
    } else {
      return <el-time-select
        v-model={data.value}
        // input={self.$emit('input', data.value)}
        picker-options={
          {
            start: data.startTime,
            step: data.timeStep,
            end: data.endTime
          }
        }
        placeholder={
          data.endName ? data.startPlaceholder : data.placeholder
        }
        class={{ form_input: true }}
      />
    }
  }
}
